package com.example.klaraservice.dao;

import com.example.klaraservice.pojo.Brand;
import com.example.klaraservice.pojo.Commodity;
import com.example.klaraservice.pojo.User;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @author : Glacialerisa
 * @date : 2023/5/26 11:40
 * @desc :
 */
@Mapper
public interface UserMapper {
    public List<User> selectAllLikeNickName(String name);

    /**
     * 根据手机号码获取唯一的用户信息
     * @param phone
     * @return
     */
    public User selectByPhone(String phone);
    public List<User> selectAllUser();
    /**
     * selectUserByPhoneAndPassword根据手机号码、密码搜索结果
     * @param phone
     * @param password
     * @return
     */
    public User selectUserByPhoneAndPassword(String phone,String password);
//    public User selectUserByPhone(String phone);
//    public User selectUserByPhoneAndPassword(String phone,String password);

    /**
     * 添加新用户
     * @param phone
     * @param password
     * @param uuid
     * @return
     */
    public boolean addUserByPhoneAndUuid(String phone,String password,String uuid);

    /**
     * 修改用户信息
     * @param user
     * @return
     */
    public boolean updateUserInfo(User user);
//    public boolean updateStateById(int id,int state);
//    public boolean updateIdentityById(int id,int identity);
    /**
     * 删除用户信息
     * @param id
     * @return
     */
    public boolean deleteUserById(int id);

}
